package services;

import java.util.ArrayList;

import android.content.Context;
import database.FTodoEntities;
import entity.FTodo;

public class FTodoService {
	public static final String TAG = FTodoService.class.getName();
	
	public static void getListFTodoByTaskName(Context context, String taskName, FTodoCallback callback){
		
		ArrayList<FTodo> ftodos = FTodoEntities.getInstance(context).getListFTodoByTaskName(taskName);
		callback.onFinish(ftodos, false);
	}
	
	public static void getListFTodoByDate(Context context, int dateFrom, int dateTo, FTodoExpandableCallback callback){
		ArrayList<Integer> groupsDate = FTodoEntities.getInstance(context).getListDate(dateFrom, dateTo);
		ArrayList<ArrayList<FTodo>> ftodos = FTodoEntities.getInstance(context).getListFTodoDate(groupsDate);
		callback.onFinish(groupsDate, ftodos, false);
	}
	
	public static void getListFTodoByDate(Context context, int date, FTodoCallback callback){
		ArrayList<FTodo> ftodos = FTodoEntities.getInstance(context).getListFTodoByDate(date);
		callback.onFinish(ftodos, false);
	}
}
